//
//  AdressInforTextViewTableViewCell.m
//  GLGW_Shoping
//
//  Created by yang on 2018/11/28.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "AdressInforTextViewTableViewCell.h"

@interface AdressInforTextViewTableViewCell ()<UITextViewDelegate>
{
    GLGWTextView * textView;
}
@end

@implementation AdressInforTextViewTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        textView = [[GLGWTextView alloc] initWithFontType:SYSTEMFONT(14) colorType:kColor_Rule_Black inSuperView:self.contentView];
        textView.delegate = self;
        textView.placeholderAttributes = @{NSFontAttributeName:[UIFont systemFontOfSize:14],NSForegroundColorAttributeName:[UIColor colorWithHexString:@"#C9C9C9"]};
        textView.placeholder = @"输入详细地址 街道、楼牌等";
        [textView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView.mas_left).offset(kWidthProportion_In_iPhoneTriploid(12));
            make.right.equalTo(self.contentView.mas_right).offset(-kWidthProportion_In_iPhoneTriploid(12));
            make.top.equalTo(self.contentView.mas_top).offset(kHeightProportion_In_iPhoneTriploid(5));
            make.bottom.equalTo(self.contentView.mas_bottom).offset(-kHeightProportion_In_iPhoneTriploid(5));
        }];
    }
    return self;
}

-(void)setInput_str:(NSString *)input_str{
    _input_str = input_str;
    textView.text = _input_str;
}

#pragma mark =================== UITextViewDelegate ===================
-(void)textViewDidChange:(UITextView *)textView{
    if (self.Block_TextViewChange) {
        self.Block_TextViewChange(textView.text);
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
